package com.bm.controller;

import com.bm.Result.CodeEnum;
import com.bm.Result.Result;
import com.bm.Vo.Complain.ComplainAllotVo;
import com.bm.query.Complain.ComplainAllotQuery;
import com.bm.service.EjyyComplainService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 86134
 * @version 1.0
 * @description TODO
 * @date 2024/3/19 19:32
 */
@RestController
@Api(tags = "投诉相关接口")
public class ComplainController {
    @Autowired
    private EjyyComplainService complainService;

    @PostMapping("/complain/allot")
    @ApiOperation(value = "分配投诉处理api")
    public Result ComplainAllot(@RequestBody ComplainAllotQuery complainAllotQuery){
        ComplainAllotVo complainAllotVo = complainService.complainAllot(complainAllotQuery);
        return complainAllotVo == null ? Result.FAIL(CodeEnum.QUERY_ILLEFAL):Result.OK(complainAllotVo);
    }

}
